#include<bits/stdc++.h>
using namespace std;
const int MAXN=1e6;
int n;
int a[MAXN];
int ans;
bool cmp(int x,int b)
{
    return x<b;
}
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    ans=n-1;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n,cmp);
    for(int i=0;i<n-1;i++)
    {
        if(a[i]>=a[i+1] && a[i]!=-1&&a[i+1]!=-1)
        {
            a[i+1]=-1;
            ans--;
        }
    }
    printf("%d", ans);
    fclose(stdin);
    fclose(stdout);
    return 0;
}
